ASK Variables

Description

When you use variables in an expression, you can use a special type of variable that asks you for its value when the expression is evaluated. These variables, called ASK variables, can be used just like any other variable. When Alpha Anywhere encounters the ASK variable, an input dialog box appears requesting that you type in a value. The expression result will depend upon the value you enter. The outcome of a query, the filter expression for an export, or the value of an update expression are all examples of operations and expressions which can be based on an ASK variable.

An ASK variable begins with one of the following prefixes depending upon the type of data you want to request:

Prefix
Data Type
ASKC_

Character

ASKD_

Date

ASKL_

Logical

ASKN_

Numeric

If an expression contains more than one ASK variable, Alpha Anywhere will display a single dialog box to prompt for all of the ASK variables at once.

The variables will be displayed in alphabetical order.

By following a simple naming convention, you can control the order in which the ASK variable prompts appear on the dialog box. Alpha Anywhere uses the portion of the ASK variable after the prefix to form the prompt used in the input dialog box. The following expression was placed in the Filter Expression field on the Filter/Order tab of the Customer Information Properties dialog box.

lastname > var->askC_Lastname .and. Firstname > var->askC_Firstname

The expression produces the following pop-up dialog box when the Customer Information form is opened.

images/Ask_Variables.gif

The dialog box that Alpha Anywhere displays prompts for the firstname field before the lastname field (since that is their alphabetical sort order). However, by renaming the ASK variables as follows, you can ensure that the dialog will prompt for the lastname field before the firstname field.

lastname > var->askC_1_Lastname .and. Firstname > var->askC_2_Firstname

See Also